import numpy as np
from sklearn.model_selection import train_test_split

#collist=['holidayvibes','gamenight','happyholidays','carsoftiktok','fallguysmoments','homecooked','veteransday','youwantmore','interiordesign','coldweather','wildanimals','mycostume','meleaving','mypfp','catchphrases','watchmegrow','holidaycrafts','growupwithme','clingypet','happyhanukkah','lunarnewyear',
#         'tabletop','comfortfood','selfimprovement','2021affirmations','perfectmatch','givingszn','holidaycountdown','bakingszn','holidaymusic','familyimpression','inkdrawing','WeekendVibes','productivity','recordsday']#'holidaycountdown',,,,,'onlinedating','festivefashion','raisedby',
#collist=['holidayvibes']#,'gamenight','happyholidays','carsoftiktok','fallguysmoments']#,'interiordesign','homecooked','veteransday','youwantmore','interiordesign','coldweather','wildanimals','mycostume','meleaving','mypfp','catchphrases','watchmegrow','holidaycrafts','growupwithme','clingypet','happyhanukkah','lunarnewyear',
        #'tabletop','comfortfood','selfimprovement','2021affirmations','perfectmatch']#,'givingszn','holidaycountdown','bakingszn','holidaymusic','familyimpression','inkdrawing','WeekendVibes','recordsday','productivity','smallbusiness']
#collist=['holidayvibes']#,'gamenight','happyholidays','carsoftiktok','fallguysmoments','interiordesign','homecooked','veteransday','youwantmore','interiordesign','coldweather','wildanimals','mycostume','meleaving','mypfp','catchphrases','watchmegrow','holidaycrafts','growupwithme','clingypet','happyhanukkah','lunarnewyear',
      # 'tabletop','comfortfood','selfimprovement','2021affirmations','perfectmatch','givingszn','holidaycountdown','bakingszn','holidaymusic','familyimpression','inkdrawing','WeekendVibes','recordsday','productivity','smallbusiness'
      # ,'falldiy','whenwewereyounger','yellow','ComingOfAge','artmas','gaminglife','gamingsetup','hellowinter','planttiktok','housetour','neonshadow','homeoffice','raisedby','makeitvogue','foodtiktok','valentinesday','yougotthis','stemlife']
collist=['wip', 'haventseen', 'ootd', 'bekind', 'personalfinance', 'cozyathome', 'RoomTour', 'theatrekids', 'ImAGhost', 'holidaytiktok', 'halloweenlook', 'happyhalloween', 'welldone', 'motivationmonday', 'thinkingabout', 'nonuancenovember', 'ourtype', 'fanedit', 'needtoknow', 'cleantok', 'graphicdesign', 'readysetshop', 'holidaysourway', 'onlinedating', 'myhobby', 'tiktokfood', 'whereilive', 'myrecommendation', 'worldseries', 'animation', 'cocinando', 'easydiy', 'diceroll', 'rnbvibes', 'festivefashion', 'holidaydecor', 'nbadraft', 'halloweenishere', 'christmas2020', 'howbizarre', 'sfxmakeup', 'givingthanks', 'holidayvibes', 'gamenight', 'happyholidays', 'carsoftiktok', 'fallguysmoments', 'interiordesign', 'homecooked', 'veteransday', 'youwantmore', 'coldweather', 'wildanimals', 'mycostume', 'meleaving', 'mypfp', 'catchphrases', 'watchmegrow', 'holidaycrafts', 'growupwithme', 'clingypet', 'happyhanukkah', 'lunarnewyear', 'tabletop', 'comfortfood', 'selfimprovement', '2021affirmations', 'perfectmatch', 'givingszn', 'holidaycountdown', 'bakingszn', 'holidaymusic', 'familyimpression', 'inkdrawing', 'WeekendVibes', 'recordsday', 'productivity', 'smallbusiness', 'falldiy', 'whenwewereyounger', 'yellow', 'ComingOfAge', 'artmas', 'gaminglife', 'gamingsetup', 'hellowinter', 'planttiktok', 'housetour', 'neonshadow', 'homeoffice', 'raisedby', 'makeitvogue', 'foodtiktok', 'valentinesday', 'yougotthis', 'stemlife']

t=[]
t_sticker=[]
img_emb = []
yamnet = []
text = []
text_sticker = []
labels = []
edits = []
img_emb_new=[]
hts=[]
ids=[]
version_num='newlyadded'
# for col in collist:
#     text.extend( np.load('E:\\newlyadded\\text_embed_'+col+'.npy'))
#     img_emb .extend( np.load('E:\\newlyadded\\image_embed_'+col+'.npy'))
#     yamnet .extend( np.load('E:\\newlyadded\\yamnet_embed_'+col+'.npy'))
#     edits .extend( np.load('E:\\newlyadded\\edit_embed_'+col+'.npy'))
#     labels.extend( np.load('E:\\newlyadded\\label_'+col+'.npy'))

htc=0
for col in collist:
    htn = np.zeros(len(collist))
    htn[htc]=1
    htc+=1
    t.extend(np.load('E:\\newlyadded\\text_newlyadded_' + col + '.npy'))
    for it in range(len(np.load('E:\\newlyadded\\text_newlyadded_' + col + '.npy'))):
        hts.append(htn)
    ids.extend(np.load('E:\\newlyadded\\ids_newlyadded_' + col + '.npy'))
    text.extend( np.load('E:\\newlyadded\\text_embed_newlyadded_'+col+'.npy'))
    t_sticker.extend(np.load('E:\\newlyadded\\text_sticker_newlyadded_' + col + '.npy'))
    text_sticker.extend(np.load('E:\\newlyadded\\text_sticker_embed_newlyadded_' + col + '.npy'))

    img_emb .extend( np.load('E:\\newlyadded\\image_embed_newlyadded_'+col+'.npy'))
    yamnet .extend( np.load('E:\\newlyadded\\yamnet_embed_newlyadded_'+col+'.npy'))
    edits .extend( np.load('E:\\newlyadded\\edit_embed_newlyadded_'+col+'.npy'))
    #labels.extend( np.load('E:\\newlyadded\\label_newlyadded_'+col+'.npy'))
    img_emb_new.extend(np.load('E:\\newlyadded\\image_embed_prob_newlyadded_'+col+'.npy'))

# t, test_t=test_split(t,test_size=0.2,random_state=42)
# ids,test_ids=test_split(ids,test_size=0.2,random_state=42)
# hts,test_hts=test_split(hts,test_size=0.2,random_state=42)
#
# t_sticker, test_t_sticker=test_split(t_sticker,test_size=0.2,random_state=42)
# img_emb,test_img_emb=test_split(img_emb,test_size=0.2,random_state=42)
# yamnet, test_yamnet=test_split(yamnet,test_size=0.2,random_state=42)
# text, test_text=test_split(text,test_size=0.2,random_state=42)
# text_sticker, test_text_sticker=test_split(text_sticker,test_size=0.2,random_state=42)
# #labels,test_labels=test_split(labels,test_size=0.2,random_state=42)
# edits,test_edits=test_split(edits,test_size=0.2,random_state=42)
#
# img_emb_new,test_img_emb_new=test_split(img_emb_new,test_size=0.2,random_state=42)
np.save('E:\\newlyadded\\image_embed_prob_'+version_num, np.array(img_emb_new))
#np.save('E:\\newlyadded\\test_image_embed_prob_'+version_num, np.array(test_img_emb))
np.save('E:\\newlyadded\\yamnet_embed_'+version_num, np.array(yamnet))
#np.save('E:\\newlyadded\\test_yamnet_embed_'+version_num, np.array(test_yamnet))
#np.save('E:\\newlyadded\\label_'+version_num, np.array(labels))
#np.save('E:\\newlyadded\\test_label_'+version_num, np.array(test_labels))
np.save('E:\\newlyadded\\edit_embed_'+version_num, edits)
#np.save('E:\\newlyadded\\test_edit_embed_'+version_num, test_edits)

np.save('E:\\newlyadded\\text_embed_'+version_num, text)
#np.save('E:\\newlyadded\\test_text_embed_'+version_num, test_text)
np.save('E:\\newlyadded\\text_sticker_embed_'+version_num, text_sticker)
#np.save('E:\\newlyadded\\test_text_sticker_embed_'+version_num, test_text_sticker)

np.save('E:\\newlyadded\\image_embed_'+version_num, np.array(img_emb))
#np.save('E:\\newlyadded\\test_image_embed_'+version_num, np.array(test_img_emb_new))
np.save('E:\\newlyadded\\text_'+version_num, t)
#np.save('E:\\newlyadded\\test_text_'+version_num, test_t)
np.save('E:\\newlyadded\\text_sticker_'+version_num, t_sticker)
#np.save('E:\\newlyadded\\test_text_sticker_'+version_num, test_t_sticker)

np.save('E:\\newlyadded\\ids_'+version_num, ids)
#np.save('E:\\newlyadded\\test_ids_'+version_num, test_ids)
np.save('E:\\newlyadded\\hts_'+version_num, hts)
#np.save('E:\\newlyadded\\test_hts_'+version_num, test_hts)